package com.xzlf;

import com.sun.org.apache.xml.internal.security.Init;
import com.xzlf.util.TaskUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;

@SpringBootApplication
@EnableScheduling
public class SpringScheduleApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringScheduleApplication.class, args);
        init(context);
    }

    @PostConstruct
    private static void init(ConfigurableApplicationContext context) {
        TaskUtil.load(context);
    }
}
